memberalter = jQuery.noConflict();
memberalter().ready(function() {


           memberalter("#member-register").validate({
		   
		   rules: {
		   'name':{
			   		minlength: 5,
					maxlength: 20,
			   		chkbadchar:true,
					splchar:true,
			   
			   },
			   
			   'mail':{
				   email:true,
				   chkbadchar:true,
				   },
				   
				   'pass[pass1]':{
					  // password :"required", 
					   //minlength:4,
					   maxlength:20,
					   checkpwd:true,
					   //validpassword:true,
					   
					   },
					   'pass[pass2]' : {
						   
						     equalTo: "#edit-pass-pass1"
							 },
		   
		   'field_office_address':{
		   					required: true,
							minlength: 5,
							maxlength: 255,
							chkbadchar:true,
							splchar:true,
							
		   
		   },
		   'field_phone_number':{
		   					
							minlength: 8,
							maxlength: 11,
							digits:true,
							
		   
		   },
		   
		   'field_mobile':{
		   
			   				
			   				
							//startmobilecode:true,
							minlength:10,
			   				maxlength:12,
			   				digits:true,
			   },
			 
			 'field_fax' :{
			 
			   				
			   				minlength:8,
			   				maxlength:11,
			   				digits:true,
			 },
			 'field_pincode':{
			 			digits:true,
						minlength:6,
						maxlength:6,
			 
			 },
		   },
		   
		   messages: {
								'field_office_address':{
								required: 'Please enter office address',
								minlength: 'Minimum 5 character only allowed',
								maxlength:  'Maximum 255 character only allowed',
								chkbadchar: 'insert, select, update, delete, drop, alter, change, modify not allowed.',
								splchar:'Special characters are not allowed',
								},
							
								'name':{
								required:'Field Value is Required',
								minlength:'Minimum 5 character only allowed',
								maxlength:'Maximum 20 character only allowed',
								chkbadchar: 'insert, select, update, delete, drop, alter, change, modify not allowed.',
								splchar:'Special Characters are not allowed',
								
								},
								'field_mobile':{
								startmobilecode:'Mobile Code should be 0 or 9 or 8 or 7',
								minlength:'Minimum number for mobile number is 10',
			   					maxlength:'Maximum number for mobile number is 12',
			   					digits:'Digits are only allowed',
									
								},
								'mail':{
				   				email:'Email should be valid',
				   				chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
				   				},
								'pass[pass1]':{
								maxlength:'Password maximum length should be 20 characters',
					   			checkpwd:'Some special characters and bad characters are not allowed',
					   			//validpassword:'The password must contain a minimum of one lower case character,one upper case character, one digit and one special character',
					   
					   			},
					   			'pass[pass2]' : {
								equalTo: 'The specified passwords do not match.',
							 	},
								'field_phone_number':{
		   						minlength: 'Minimum phone number is 8 numbers',
								maxlength: 'Maximum phone number is 11 numbers',
								digits:'Only numbers are allowed',
								},
								'field_fax' :{
								minlength:'Minimum fax number is 8 numbers',
			   					maxlength:'Maximum fax number is 11 numbers',
			   					digits:'Only numbers are allowed',
			 					},
								'field_pincode':{
			 					digits:'Only numbers are allowed',
								minlength:'Minimum 6 numbers only allowed',
								maxlength:'Maximum 6 character only allowed',
			 
			 },
		
							},
							//errorLabelContainer: "#errormsg_container",
					 //focusInvalid: false,
   					invalidHandler: function(form, validator) {
       
       					 if (!validator.numberOfInvalids())
								return;
						else{
							
							 // memberalter("#announcements-node-form").create_errormsg_container('errormsg_container','announcements-node-form');
						}
							
							memberalter('html, body').animate({
								scrollTop: memberalter(validator.errorList[0].element).offset().top - 100
							}, 1000);
							
						},
				

   
	});
	
	});	   
		   
		   